<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePhotosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('photos', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('plan_id')->unsigned()->default(0)->index()->comment('拍摄计划id');
            $table->bigInteger('user_id')->unsigned()->default(0)->index()->comment('用户id');
            $table->string('path')->comment('图片地址');
            $table->string('retouch_path')->default('')->comment('精修图地址');
            $table->string('description')->default('')->comment('描述');
            $table->tinyInteger('retouch')->unsigned()->default(0)->comment('是否需要精修');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('photos');
    }
}
